// 文章列表相关的axios的请求
import request from '@/utlis/request.js'

export function getArticles(params) {
  return request({
    method: 'GET',
    url: '/v1_0/articles',
    params
  })
}

// 获取具体的文章详情
export function getArticlesContent(article_id) {
  return request({
    method: 'GET',
    url: `/v1_0/articles/${article_id}`,
  })
}

// 收藏文章
export function collectArticle(target) {
  return request({
    method: 'POST',
    url: `/v1_0/article/collections`,
    data: {
      target
    }
  })
}

// 取消收藏
export function deletecollectArticle(target) {
  return request({
    method: 'DELETE',
    url: `/v1_0/article/collections/${target}`,
  })
}

// 点赞文章
export function likeArticle(target) {
  return request({
    method: 'POST',
    url: '/v1_0/article/likings',
    data: {
      target
    }
  })
}

// 取消点赞
export function deletelikeArticle(target) {
  return request({
    method: 'DELETE',
    url: `/v1_0/article/likings/${target}`,
  })
}


